/*
 *  $TEAM_NAME Space Trader
 */
package views;

import models.Ship;

import javax.swing.table.TableCellRenderer;
import javax.swing.JTable;
import javax.swing.JLabel;
import java.awt.Component;
import java.awt.Color;

/**
 * Ship Cell Renderer for Shipyard table
 * @author twb
 * @version 1.0
 */
public class ShipCellRenderer extends JLabel implements TableCellRenderer {
	/**
	 * The version for serialization.
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Default constructor
	 */
    public ShipCellRenderer() {
        super.setOpaque(true);
    }

    /**
     * @param table
     * @param ship
     * @param isSelected
     * @param hasFocus
     * @param row
     * @param height
     * @return The component for rendering the cell
     */
    public Component getTableCellRendererComponent(
    		JTable table, Object ship, 
    		boolean isSelected, 
    		boolean hasFocus, 
    		int row, int height) {
        final Ship thisShip = (Ship) ship;
        System.out.println(thisShip);

        setBackground(Color.WHITE);
        return this;
    }
}
